//#include <base.js>
//#include <openlayersExt.js>
//#include <event.js>


/**
* 
* Classe CWN2.MapPanelBuilder - Build the MapPanel
* 
* @namespace CWN2
* @class MapPanelBuilder
* 
*/

CWN2.MapPanelBuilder = {
	
	/**
	* 
	* Build the MapPanel
	* 
	* @method build
	* 
	* 
	*/ 
	
	build: function() {
		
		if(CWN2.base.DEBUG) {
			console.log('CWN2.MapPanelBuilder');
		} 
		var panelOptions = {
			id: "cwn2-map-panel",
			xtype: "gx_mappanel",
			region: 'center',
			border: false,
			map: CWN2.base.map
	    };

	    if (CWN2.configuration.layout.title) {
		    panelOptions.title = CWN2.configuration.layout.title;
		}

		// statusbar
		var statusbar = CWN2.StatusbarBuilder.build();
		panelOptions.bbar = statusbar;
		
		// toolbar
		if (CWN2.configuration.toolbar) {
			var toolbar = CWN2.ToolbarBuilder.build();
		    panelOptions.tbar = toolbar;
		}
		
		return new GeoExt.MapPanel(panelOptions);

	}
	
};	
	

